/**
 * Created by zhangguoyu on 16/5/2.
 */

var util = require('util');
var events = require('events');

var Oop = function () {
  events.EventEmitter.call(this);
};

util.inherits(Oop, events.EventEmitter);

Oop.prototype.parent = function () {
  var p = this.__proto__;
  while (p.constructor === this.constructor && p.__proto__) {
    p = p.__proto__;
  }
  return p;
};

module.exports = Oop;